<template>
  <el-form :model="{}" ref="form" label-width="144px" class="ccui-form">
    <el-card shadow="never" v-for="item in filterDetail" :key="item.id">
      <div slot="header">供应商{{ item.suppType }}：</div>

      <detailBaseColInfo
        :colList="jsList.financeFormList"
        :colDetail="item"
        :highlightArr="isChange ? item.changeFieldsArray : []"
      />
    </el-card>
  </el-form>
</template>

<script>
import { cloneDeep } from "lodash";
import jsList from "../js";
import publicComponent from "@/basa/components/public";

export default {
  name: "detailFinanceInfo",
  props: {
    detail: {
      type: Array,
      default: () => []
    },
    // 是否是变更页面引用
    isChange: {
      type: Boolean,
      default: false
    }
  },
  components: {
    detailBaseColInfo: publicComponent.detailBaseColInfo
  },
  data() {
    return {
      filterDetail: []
    };
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      this.filterDetail = cloneDeep(this.detail);
      if (this.filterDetail.length < 2) {
        this.filterDetail.push({ suppType: 2 });
      }
    }
  },
  computed: {
    jsList: () => jsList
  }
};
</script>

<style lang="scss" scoped>
/deep/ .el-card,
/deep/ .el-card__header {
  border: 0;
}
</style>
